﻿using NHibernate;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;

namespace OneStationFile.IDAL
{
    public interface IBaseDao
    {
        bool SaveOrUpdate<T>(T t);
        T GetModelById<T>(int id);
        IQueryOver<T> GetModels<T>() where T : class;
        int ExistModelByWhere<T>(Expression<Func<T, bool>> expression) where T : class;
        bool DeleteModelById<T>(int id);
        List<T> GetModelsByWhere<T>(Expression<Func<T, bool>> expression) where T : class;
        T GetModelByWhere<T>(Expression<Func<T, bool>> expression) where T : class;
    }
}
